<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 贪婪模式 
        const str = '2023-07-13,2022-06-13,2023-08-13';
        // console.log(str.replace(/(\d{4})-(\d{2})-(\d{2})/g, '$2/$3/$1'));
        console.log(str.replace(/(?<y>\d{4})-(?<m>\d{2})-(?<d>\d{2})/g, '$<m>/$<d>/$<y>'));
        console.log(str.replace(/(?<y>\d{4})-(?<m>\d{2})-(?<d>\d{2})/g, '$<m>月$<d>日$<y>年'));









    </script>
</body>

</html>